<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>controlP5 : : Slider</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="stylesheet.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
document.getElementsByTagName('html')[0].className = 'isjs';

function toggle(dt) 
{ 
  var display, dd=dt; 
  /* get dd */ 
  do{ dd = dd.nextSibling } while(dd.tagName!='DD'); 
  toOpen =!dd.style.display; 
  dd.style.display = toOpen? 'block':'' 
  dt.getElementsByTagName('span')[0].innerHTML 
    = toOpen? '-':'+' ; 
} 
</script>
</head>
<body>
<div id="container">
		<div id="header">
		<a href="./index.htm"><img src="./docuImages/title.jpg" /></a>
		</div>
	<div class="content">
		<h1>Slider</h1>
		<dl><dt class="key">description</dt><dd class="value">a slider is either used horizontally or vertically. when adding a slider to controlP5, 
 the width is compared versus the height. width is bigger, you get a horizontal slider,
 height is bigger, you get a vertical slider.
 a slider can have a fixed slide controller (one end of the slider is fixed to the left or
 bottom side of the controller), or a flexible slide control (a knob that you can drag).</dd></dl>
			
			<div class="toggleList example">
				<dl><dt onclick="toggle(this)"><span>+</span>Example</dt>
					<dd><pre>import controlP5.*;


ControlP5 controlP5;

int myColorBackground = color(0,0,0);

int sliderValue = 100;

void setup() {
  size(400,400);
  controlP5 = new ControlP5(this);
 Slider s = controlP5.addSlider("slider",100,167,128,100,160,10,100);
  s = controlP5.addSlider("sliderValue",0,255,128,200,200,10,100);
}

void draw() {
  background(myColorBackground);
  fill(sliderValue);
  rect(0,0,width,100);
}

void slider(float theColor) {
  myColorBackground = color(theColor);
  println("a slider event. setting background to "+theColor);
}
</pre></dd>
				</dl>
			</div>
			
			
			
			<dl><dt class="key">constructors</dt><dd class="value"><pre></pre></dd></dl>
			
			
			
			
			
			
			
			<!-- METHODS:BEGIN -->
			
       <dl class="noborder"><dt>Methods</dt></dl>
       <dl><dt class="key"><a href="slider_method_setheight.htm">setHeight ( )</a></dt><dd class="value">set the height of the slider.</dd></dl>
<dl><dt class="key"><a href="slider_method_setmax.htm">setMax ( )</a></dt><dd class="value">set the maximum value of the slider.</dd></dl>
<dl><dt class="key"><a href="slider_method_setmin.htm">setMin ( )</a></dt><dd class="value">set the minimum value of the slider.</dd></dl>
<dl><dt class="key"><a href="slider_method_setslidermode.htm">setSliderMode ( )</a></dt><dd class="value">use the slider mode to set the mode of the slider bar, which can be
 Slider.FLEXIBLE or Slider.FIX</dd></dl>
<dl><dt class="key"><a href="slider_method_setvalue.htm">setValue ( )</a></dt><dd class="value">set the value of the slider.</dd></dl>
<dl><dt class="key"><a href="slider_method_setwidth.htm">setWidth ( )</a></dt><dd class="value">set the width of the slider.</dd></dl>

   
			<!-- METHODS:END -->
			<div class="separator">
			<dl><dt class="key">usage</dt><dd class="value">Web & Application</dd></dl>
			</div>
			<div class="separator">
			<dl><dt class="key">related</dt><dd class="value"><ul><li><a href="controller_class_controller.htm">Controller</a></li>
</ul></dd></dl>
			</div>
	</div>
	<div id="footer">
	<p>by andreas schlegel (<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">cc</a>) 2007, <a href="http://www.sojamo.de" target="_blank">sojamo</a>.</p>
	</div>
</div>
</body>
</html>


